<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@3.2.38/dist/vue.global.min.js"></script>
</head>

<body>
<div id="app">
    <input type="text" v-model="msg"><button @click="add">提交</button>
    <ul v-for="item in list">
        <li>{{item}}</li>
    </ul>
</div>
</body>


<script>
    Vue.createApp({
        data() {
            return {
                msg: '',
                list: [1, 2, 3]
            }
        },
        methods: {
            add() {
                this.list.push(this.msg)
            }
        }
    }).mount('#app')


</script>

</html>